<template>
    <div v-for="(items, product) in List" :key="product">
      <h1>{{ product }}</h1>
        <li v-for="item in items" :key="item.name">
          {{ item.name }} - ￥{{ item.price }}
        </li>
    </div>
</template>
<script setup>
import { ref } from 'vue'
let List = ref({
  电子产品: [
    { name: '手机', price: 3999 },
    { name: '耳机', price: 599 },
  ],
  食品: [
    { name: '面包', price: 10 },
    { name: '牛奶', price: 8 },
  ]
})
</script>
<style>
</style>